

package com.scs.application.modules.order.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 发货单实体对象
 *
 */
@TableName("delivery")
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@Accessors(chain = true)
public class DeliveryVO implements Serializable {

    private String id;
    /**
     * 院方ID
     */
    private String hospitalId;

    /**
     * 院方名称
     */
    @Excel(name = "院方名称", width = 16, needMerge = true)
    private String hospitalName;

    /**
     * 发货单号
     */
    @Excel(name = "发货单号", width = 18, needMerge = true)
    private String code;

    /**
     * 订单ID
     */
    @NotNull(message = "订单ID不能为空")
    private String poId;

    /**
     * 采购单号
     */
    @Excel(name = "采购单号", width = 18, needMerge = true)
    @NotBlank(message = "采购单号不能为空")
    @Length(min = 1, max = 50, message = "采购单号长度必须介于 1 和 50 之间")
    private String poCode;

    /**
     * 供应商ID
     */
    private String supplierId;

    /**
     * 供应商名称
     */
    @Excel(name = "供应商名称", width = 28, needMerge = true)
    private String supplierName;

    /**
     *  送达地点id
     */
    private String warehouseId;
    /**
     *  收货仓库代码
     */
    private String warehouseCode;

    /**
     *  送达地点名称
     */
    @Excel(name = "送达地点名称", width = 12, needMerge = true)
    private String warehouseName;

    /**
     * 是否手工发货单
     */
    private Integer isManual;

    /**
     * 是否寄售
     */
    @Excel(name = "是否寄售",dict = "common_yes_no", needMerge = true)
    private String isConsignment;

    /**
     * 是否一物一码
     */
    @Excel(name = "是否一物一码",dict = "common_yes_no", width = 13, needMerge = true)
    private String isOneThingOneYard;

    /*** 送达日期*/
    @Excel(name = "送达日期",format = "yyyy-MM-dd", width = 11, needMerge = true)
    private java.util.Date gmtRequireLatestDelivery;

    /**
     * 预计最早送达日期
     */
    @Excel(name = "预计最早送达日期",format = "yyyy-MM-dd", width = 16, needMerge = true)
//    @Future(message = "最早送达日期不能早于当前时间")
    private java.util.Date gmtExceptedEarliestDelivery;

    /**
     * 预计最晚送达日期
     */
    @Excel(name = "预计最晚送达日期",format = "yyyy-MM-dd", width = 16, needMerge = true)
//    @Future(message = "最晚送达日期不能早于当前时间")
    private java.util.Date gmtExceptedLatestDelivery;

    /**
     * 实际送达日期
     */
    @Excel(name = "实际送达日期",format = "yyyy-MM-dd", width = 12, needMerge = true)
    private java.util.Date gmtActualDelivery;



    /**
     * 订单金额(元)
     */
    @Excel(name = "订单金额(元)", width = 11, needMerge = true)
    @NotNull(message = "订单金额(元)不能为空")
    private Double orderAmount;

    /**
     * 发货金额(元)
     */
    @Excel(name = "发货金额(元)", width = 11, needMerge = true)
    private Double deliveryAmount;

    /**
     * 发货时间
     */
    @Excel(name = "发货时间", format = "yyyy-MM-dd",needMerge = true)
    @TableField(strategy = FieldStrategy.IGNORED)
    private java.util.Date gmtDelivery;

    /**
     * 状态
     */
    @Excel(name = "状态", dict = "order_delivery_status", needMerge = true)
    private String status;

    /**
     * 订单来源标识
     */
    private String sourceKey;

    @ExcelCollection(name = "发货单明细")
    private List<DeliveryItemVO> items;


    private Integer isClosed;

    /**  供应商移动电话 */
    private String mobile;

    /** 供应商联系人 */
    private String contactor;


    private String remark;

    /**1：药品，2：耗材，3：试剂 默认耗材 **/
    private Integer materialTypeCode;

    /**1：发货温度**/
    private String temperature;

    /* 第三方订单id */
    private String thirdDeliveryId;

    /**
     * 来源类型 scp 供应商平台手动创建的 lms 从lms系统传入的
     */
    private String fromType;

}
